﻿using System;
using System.Collections.Generic;
using System.Text;
using Mmht.DB;
using System.Data;

namespace Mmht.BT
{
    public class NoticeBT
    {
        NoticeDB ndb = new NoticeDB();
        /// <summary>
        /// 得到所有的通知，按时间排序，最近的在考前
        /// </summary>
        /// <returns></returns>
        public DataTable GetAllNotice()
        {
            return ndb.GetAllNotice();
        }
        /// <summary>
        /// 得到就近的几条通知，只包含name和emergency两个字段
        /// </summary>
        /// <param name="number"></param>
        /// <returns></returns>
        public DataTable GetLatestNotice(int number)
        {
            return ndb.GetLatestNotice(number);
        }

        public bool InsertNotice(string name, string notice, bool emergency, int created_by)
        {
            return ndb.InsertNotice(name, notice, emergency, created_by);
        }
        public bool delNotice(int id) 
        {
            return ndb.delNotice(id);
        }
        public bool delAllNotice() 
        {
            return ndb.delAllNotice();
        }
    }
}
